package view.items;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Panel;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import controller.Controller;
import controller.ControllerLighter;

import model.Call;

public class PanelActiveCallRequestSend extends PanelAbstract {



	public PanelActiveCallRequestSend(Call call, Controller controller,ControllerLighter controllerLighter){
		super(call, controllerLighter);
		
		 JLabel label = new JLabel("Calling.... ");
		 label.setPreferredSize(new Dimension(50,30));
		label.setForeground(this.colorLabel);
		 JLabel label2 = new JLabel(call.getIp().toString().replace("/", "")+":"+call.getTcpService().getSocket().getPort());
		 label2.setForeground(this.colorLabel);
		 label2.setPreferredSize(new Dimension(177, 30));
		 label2.setBackground(Color.red);
		
		 
		 ImageIcon iconCancel = new ImageIcon(getClass().getResource("/img/close.png"));
		 JButton buttonCancel = new JButton(iconCancel);
		buttonCancel.setFont(new Font("Arial",Font.ITALIC,10));
		buttonCancel.setMargin(new Insets(0, 0, 0, 0));
		buttonCancel.setPreferredSize(new Dimension(23,23));
		buttonCancel.setActionCommand("buttonCancel");
		buttonCancel.addActionListener(controller);
		buttonCancel.setContentAreaFilled(false);
		buttonCancel.setBorderPainted(false);
		buttonCancel.setToolTipText("Click to cancel Call Request");
		
		this.add(label);
		this.add(label2);
		ImageIcon ii = new ImageIcon(getClass().getResource("/img/dial3.gif"));
		JLabel jl = new JLabel();
	
		jl.setIcon(ii);
		jl.setPreferredSize(new Dimension(25,25));
		jl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
		this.add(jl);
		this.add(buttonCancel);
	}
}
